home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10211 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1022 b 

  1. Path: news.mindlink.net!uniserve!dudd!carl
  2. From: Carl@dudd.uniserve.com (Carl)
  3. Date: 05 Mar 96 20:25:08 
  4. Newsgroups: comp.lang.c++
  5. Subject: Template declaration in h file and cpp file
  6. Message-ID: <6cc_9603060955@dudd.uniserve.com>
  7. X-FTN-To: mikael@academey.bastad.se
  8. Organization:  De Udda Edda [604] 852-4568 V34+ 33.6 
  9.  
  10. -=> Quoting mikael@academey.bastad.se to All <=-
  11.  
  12.  
  13.  mi> The problem is that the linker returns the following error:
  14.  mi> Undefinded symbol QSort(int,int,int far *); in module test.cpp
  15. just add the line
  16. QSort(int,int,int far *);
  17. before the main() (or after it if you really want to... but that's outdated)
  18. and be sure to included the semicolon on the end... otherwise it will think
  19. you are redefining the function when in fact you are merely declaring it.
  20.  mi> This problem doesent occur if the main function is in SORT.CPP below
  21.  mi> the QSort function. 
  22. Ya.. but try moving QSort underneath main() and you'll see the same result
  23. All you need is a prototype declared at the top just like I showed ya
  24.